package cn.iocoder.aics.module.member.dal.mysql.shareinfo;

import java.util.*;

import cn.iocoder.aics.framework.common.pojo.PageResult;
import cn.iocoder.aics.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.aics.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.aics.module.member.dal.dataobject.shareinfo.ShareInfoDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.aics.module.member.controller.admin.shareinfo.vo.*;

/**
 * 分享数据 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface ShareInfoMapper extends BaseMapperX<ShareInfoDO> {

    default PageResult<ShareInfoDO> selectPage(ShareInfoPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ShareInfoDO>()
                .eqIfPresent(ShareInfoDO::getShareUserId, reqVO.getShareUserId())
                .eqIfPresent(ShareInfoDO::getAcceptUserId, reqVO.getAcceptUserId())
                .eqIfPresent(ShareInfoDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(ShareInfoDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ShareInfoDO::getId));
    }

}